package com.captcha.demo.controller;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RequestMapping("/logger")
@RestController
public class LoggerController {
    private static Logger logger = LoggerFactory.getLogger(LoggerController.class);

    @RequestMapping("/log")
    public String log() {
        logger.info("打印日志");
        System.out.println("打印日志");
        return "log";
    }


    @RequestMapping("/level")
    public String level() {
        logger.error("error 级别日志");
        logger.warn("warn 级别日志");
        logger.info("info 级别日志");
        logger.debug("debug 级别日志");
        logger.trace("trace 级别日志");
        return "level";
    }
}
